package com.hsh.server.project.bank.service.impl;

import java.util.Collections;
import java.util.List;

import com.hsh.server.interceptor.UserUtils;
import com.hsh.server.project.bank.domain.TAppTransaction;
import com.hsh.server.project.bank.mapper.TAppTransactionMapper;
import com.hsh.server.project.bank.service.ITAppTransactionService;
import com.hsh.server.project.bank.vo.TAppTransactionVo;
import com.hsh.server.util.DateUtils;
import com.hsh.server.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * 交易回单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-23
 */
@Service
public class TAppTransactionServiceImpl implements ITAppTransactionService
{

    @Autowired
    private TAppTransactionMapper tAppTransactionMapper;

    /**
     * 查询交易回单
     * 
     * @param id 交易回单主键
     * @return 交易回单
     */
    @Override
    public String selectTAppTransactionById(Long id)
    {
        String s = tAppTransactionMapper.selectTAppTransactionById(id);
        String resS = "http://ye38178as535.vicp.fun"+s;
        return resS;
    }

    /**
     * 查询交易回单列表
     * 
     * @param tAppTransaction 交易回单
     * @return 交易回单
     */
    @Override
    public List<TAppTransactionVo> selectTAppTransactionList(TAppTransaction tAppTransaction)
    {
        tAppTransaction.setId(UserUtils.getUserInfo().getId());
        return tAppTransactionMapper.selectTAppTransactionList(tAppTransaction);
    }

    /**
     * 新增交易回单
     * 
     * @param tAppTransaction 交易回单
     * @return 结果
     */
    @Override
    public int insertTAppTransaction(TAppTransaction tAppTransaction)
    {
        tAppTransaction.setCreateTime(DateUtils.getNowDate());
        return tAppTransactionMapper.insertTAppTransaction(tAppTransaction);
    }

    /**
     * 修改交易回单
     * 
     * @param tAppTransaction 交易回单
     * @return 结果
     */
    @Override
    public int updateTAppTransaction(TAppTransaction tAppTransaction)
    {
        return tAppTransactionMapper.updateTAppTransaction(tAppTransaction);
    }

    /**
     * 批量删除交易回单
     * 
     * @param ids 需要删除的交易回单主键
     * @return 结果
     */
    @Override
    public int deleteTAppTransactionByIds(Long[] ids)
    {
        return tAppTransactionMapper.deleteTAppTransactionByIds(ids);
    }

    /**
     * 删除交易回单信息
     * 
     * @param id 交易回单主键
     * @return 结果
     */
    @Override
    public int deleteTAppTransactionById(Long id)
    {
        return tAppTransactionMapper.deleteTAppTransactionById(id);
    }
}
